package com.qd.panda.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 收货地址
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("panda_shop_address")
public class ShopAddress extends Model<ShopAddress> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;
    /**
     * 收货人姓名
     */
    @TableField("name")
    private String name;
    /**
     * 手机号码
     */
    @TableField("phone")
    private String phone;
    /**
     * 所在地区
     */
    @TableField("region")
    private String region;
    /**
     * 详细地址
     */
    @TableField("address")
    private String address;
    /**
     * 邮政编码
     */
    @TableField("postal_code")
    private String postalCode;
    /**
     * 添加时间
     */
    @TableField("add_time")
    private LocalDateTime addTime;
    /**
     * 修改时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;
    /**
     * 默认收货地址
     */
    @TableField("default_address")
    private String defaultAddress;
    /**
     * 用户ID
     */
    @TableField("user_id")
    private String userId;

    public void freeData() {
        this.id = null;
        this.name = null;
        this.phone = null;
        this.region = null;
        this.address = null;
        this.postalCode = null;
        this.addTime = null;
        this.updateTime = null;
        this.defaultAddress = null;
        this.userId = null;
    }

}
